<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>登录</title>
	</head>
	<body>
		<form onsubmit="return check()" id="loginModel" action="${pageContext.request.contextPath}/login/login" method="post">
		<table align="center">
			<tr>
				<td>
					登录名：
				</td>
				<td>
					<input name="username" id="username" />
				</td>
			</tr>
			<tr>
				<td>
					登录密码：
				</td>
				<td>
					<input name="password" id="password" />
				</td>
			</tr>
			<tr>
				<td>
					验证码：
				</td>
				<td>
					<input name="imageNO" id="imageNO" /><img  title="看不清?点击换一张" src="${pageContext.request.contextPath}/jcaptcha" id="safecode" onclick="this.src='${pageContext.request.contextPath}/jcaptcha?date='+new Date().getTime()" width="48" height="25" />
				</td>
			</tr>
			<tr>
				<td>
					<input type="submit" value="提交" />
				</td>
				<td>
					<input type="reset" value="重置" />
				</td>
			</tr>
		</table>
		</form>
	</body>
	
	<script type="text/javascript">
		if("" !="${loginModel.wrongMsg}")
			alert("${loginModel.wrongMsg}");
		function resetSet(){
			document.getElementById("username").value="";
			document.getElementById("password").value="";
			document.getElementById("imageNO").value="";
			}

		function check(){
			if(""==document.getElementById("username").value){
				alert("请填写登录名");
				document.getElementById("username").focus();
				return false;
				}
			if(""==document.getElementById("password").value){
				alert("请填写登录密码");
				document.getElementById("password").focus();
				return false;
				}

			if(""==document.getElementById("imageNO").value){
				alert("请填写验证码");
				document.getElementById("imageNO").focus();
				return false;
				}
			return true;
			}
		
		function checkLoginNameAndPassword(a){
			var fibdn = new Array ("'" ,"\\","/");
			var i=fibdn.length;
			var j=a.length;
			for (var ii=0; ii＜i; ii++){
					for (var jj=0; jj＜j; jj++){
						temp1=a.charAt(jj);
						temp2=fibdn[ii];
						if (temp1==temp2){
							return 0;
						}
					}
			}
			return 1;
		}
	</script>
</html>